package demo4;

import org.junit.jupiter.api.Test;

import java.util.Stack;

public class GraphDemoTest2 {

    @Test
    public void test1(){

        GraphDemo2 graphDemo2 = new GraphDemo2();

        GraphDemo2.Graph graph = graphDemo2.makeUpGraph();
        String[] projects= new String[]{"e","f","b","d","a","c"};
        String[][] strings = {
                {"f", "a"},
                {"f", "b"},
                {"a", "d"},
                {"b", "d"},
                {"d", "c"}
        };
        Stack<GraphDemo2.Project> buildOrder = graphDemo2.findBuildOrder(projects, strings);
        if(buildOrder==null){
            System.out.println("circluar dependence");
        }else{
            String s = graphDemo2.stackToString(buildOrder);
            System.out.println(s);
        }


    }
}
